package com.gcd.gym.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gcd.gym.mapper.ReserveMapper;
import com.gcd.gym.model.Reserve;
import com.gcd.gym.model.searchModel.ReserveSearchModel;
import com.gcd.gym.service.ReserveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ReserveServiceImpl implements ReserveService {
    private ReserveMapper reserveMapper;

    @Autowired
    public void setReserveMapper(ReserveMapper reserveMapper) {
        this.reserveMapper = reserveMapper;
    }

    @Override
    public Page<ReserveSearchModel> findReserve(Page<ReserveSearchModel> page, ReserveSearchModel reserve) {
        return reserveMapper.findReserve(page,reserve);
    }

    @Override
    public boolean cancelReserve(Integer id) {
        return reserveMapper.deleteReserveById( id)==1;
    }

    @Override
    public boolean editReserve(Reserve reserve) {
        return reserveMapper.editReservice(reserve)==1;
    }
}
